
%include "ASMimplibs.sas";

/** Import 2002 County Business Patterns file. **/

PROC IMPORT OUT=CBP02 (keep = fipstate fipscty emp naics) 
DATAFILE= "Cbp02co.txt" 
  DBMS=CSV REPLACE;
  GETNAMES=YES;
  DATAROW=2; 
RUN;

data cbp02 (keep = fipstate fipscty emp);
set cbp02;
if naics="23----";   /* Keep only the construction sector records. */
run;

proc datasets library=work;
modify cbp02;
 rename fipstate=FIPSST fipscty=COU emp=constr_emps;
RUN;

/* For counties with construction sector employment suppressed, impute an exact number
   using the midpoint of the range represented by the code (A-H).
   This is the same procedure using by Syverson (2004 JPE). */
data asmimput.constr_emp02;
 set cbp02;
 if constr_emps="A" then constr_emps = 10;
 else if constr_emps="B" then constr_emps = 60;
 else if constr_emps="C" then constr_emps = 175;
 else if constr_emps="E" then constr_emps = 375;
 else if constr_emps="F" then constr_emps = 750;
 else if constr_emps="G" then constr_emps = 1750;
 else if constr_emps="H" then constr_emps = 3750;
run;


